using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Security.Controllers {
  [Authorize]
  public class Secured : Controller {
    public IActionResult Index() {
      return View();
    }

    [Authorize(Roles = "Boss")]
    public IActionResult ForBoss() {
      return View();
    }

    [Authorize(Roles = "Manager")]
    public IActionResult ForManager() {
      return View();
    }

    [Authorize(Roles = "PowerUser")]
    public IActionResult ForPowerUser() {
      return View();
    }

    [Authorize(Roles = "Clerk")]
    public IActionResult ForClerk() {
      return View();
    }

    [Authorize(Roles = "Guest")]
    public IActionResult ForGuest() {
      return View();
    }

    [Authorize(Roles = "Boss")]
    [Authorize(Roles = "Manager")]
    public IActionResult ForBossAndManager() {
      return View();
    }

    [Authorize(Roles = "Boss,Manager")]
    public IActionResult ForBossOrManager() {
      return View();
    }

    [AllowAnonymous]
    public IActionResult Info() =>
      Content("This info is for Secured controller where registered users can access");
  }
}
/*
Password=P@$$w0rd


CKLeng (ckleng1964@gmail.com)
  - Boss
  - PowerUser
  
Ali (ali@ckleng.onmicosoft.com)
  - PowerUser
  - Manager
  
Ahmad (ahamd@ckleng.onmicrosoft.com)
  - PowerUser
  
Abu (abu@ckleng.onmicosoft.com)
  - Guest
  
Aminah (aminah@ckleng.onmicrosoft.com)
  - Clerk
  
Aaron (aaron@ckleng.onmicosoft.com)
*/ 